import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-03-14
 * Time: 20:37
 */
class WashMachine {
    //字段/成员属性/成员变量：定义在类中，但是在方法的外面
    public String brand; // 品牌
    public String type; // 型号
    public double weight; // 重量
    public double length; // 长
    public double width; // 宽
    public double height; // 高
    public String color; // 颜色

    //成员方法
    public void washClothes(){ // 洗衣服
        System.out.println("洗衣功能");
    }
    public void dryClothes(){ // 脱水
        System.out.println("脱水功能");
    }
    public void setTime(){ // 定时
        System.out.println("定时功能");
    }
}
class Person {
    public String name;
    public int age;
    public void eat() {
        System.out.println(name+"在吃饭");
    }
}

public class Test2 {
    public static void main(String[] args) {
        Person person1 = new Person();
        person1.name = "amy";
        System.out.println(person1.name);
        person1.eat();

        Person person2 = new Person();
        person2.name = "tom";
        System.out.println(person2.name);
        person2.eat();

//        Scanner scanner = new Scanner(System.in);
////        int n = scanner.nextInt();
    }
    public static void main1(String[] args) {
        //washMachine是引用变量，存了对象的地址，实例化队形
        // 可以用new实例化多个对象
        WashMachine washMachine1 = new WashMachine();
        washMachine1.brand = "小天鹅";
        System.out.println(washMachine1.brand);

        WashMachine washMachine2 = new WashMachine();
        washMachine2.brand = "海尔";
        System.out.println(washMachine2.brand);
    }
}
